package xyz.eden.cloud.common.web.support.application.converter;



import xyz.eden.cloud.common.web.support.application.dto.OperatorInfoDTO;
import xyz.eden.cloud.common.web.support.domain.ability.model.OperatorInfo;

import java.util.Optional;

public class BaseServiceConverter {

    public static OperatorInfo builderO(OperatorInfoDTO dto) {
        return Optional.ofNullable(dto).map(d -> {
            return OperatorInfo.builder()
                    .username(d.getUsername()).dateTime(d.getDateTime()).ipAddr(d.getIpAddr())
                    .build();
        }).orElse(null);

    }
}
